<!DOCTYPE HTML>
<html>

<head>
	<meta charset="UTF-8" />
	<meta http-equiv="Cache-Control" content="no-cache" />
	<meta content="telephone=no" name="format-detection" />
	<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">
	<meta name="keywords" content="#" />
	<meta name="description" content="#" />
	<script src="datePicker.js"></script>
	<title></title>
</head>

<body>

	点击输入框触发
	<input id="dateShow" readonly>
	<script type="text/javascript">
		function curDateTime() {
			var d = new Date();
			var year = d.getFullYear();
			var month = d.getMonth() + 1;
			var date = d.getDate();
			var day = d.getDay();
			var hours = d.getHours();
			var minutes = d.getMinutes();
			var seconds = d.getSeconds();
			var ms = d.getMilliseconds();
			var curDateTime = year;
			if (month > 9)
				curDateTime = curDateTime + "-" + month;
			else
				curDateTime = curDateTime + "-0" + month;
			if (date > 9)
				curDateTime = curDateTime + "-" + date;
			else
				curDateTime = curDateTime + "-0" + date;
			return curDateTime;
		}
		var calendar = new datePicker();
		calendar.init({
			'trigger': '#dateShow',/*按钮选择器，用于触发弹出插件*/
			'type': 'datetime', /*模式：date日期；datetime日期时间；time时间；ym年月；*/
			'minDate': curDateTime(),
			/*最小日期*/
			'maxDate': '3018-12-31',
			/*最大日期*/
			'onSubmit': function () { /*确认时触发事件*/
				var theSelectData = calendar.value;
			},
			'onClose': function () { /*取消时触发事件*/ }
		});
	</script>
</body>

</html>